Part Number Hot Search : 
PHD32UAA 02111 LVCH16 620DW 0V10X MBD301 MC10H1 R3211425
Product Description
Full Text Search
 

To Download HT46R65211 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  ht46r652 a/d with lcd type 8-bit otp mcu rev. 1.10 1 may 25, 2011 features  operating voltage: f sys =4mhz: 2.2v~5.5v f sys =12mhz: 3.3v~5.5v  32 bidirectional i/o lines  two external interrupt inputs  two 16-bit programmable timer/event counters with pfd (programmable frequency divider) function  lcd driver with 41  3or40  4 segments (logical output option for seg0~seg23)  8k 16 program memory  384 8 data memory ram  pfd for sound generation  real time clock (rtc)  8-bit rtc prescaler  watchdog timer  buzzer output  on-chip crystal, rc and 32768hz crystal oscillator  power-down function and wake-up features reduce power consumption  16-level subroutine nesting  8-channel 12-bit resolution a/d converter  16-channel 8-bit pwm output shared with 16 i/o lines  bit manipulation instruction  16-bit table read instruction  up to 0.33  s instruction cycle with 12mhz system clock  63 powerful instructions  all instructions in 1 or 2 machine cycles  low voltage reset/detector function  100-pin lqfp package general description the ht46r652 is an 8-bit, high performance, risc ar - chitecture microcontroller devices specifically designed for a/d product applications that interface directly to an - alog signals and which require an lcd interface. the advantages of low power consumption, i/o flexibil - ity, timer functions, oscillator options, multi-channel a/d converter, pulse width modulation function, power-down and wake-up functions, in addition to a flexible and configurable lcd interface enhance the versatility of these devices to control a wide range of ap - plications requiring analog signal processing and lcd interfacing, such as electronic metering, environmental monitoring, handheld measurement tools, motor driv - ing, etc. for both the industrial and home appliance ap - plication areas. technical document  tools information  faqs  application note  ha0003e communicating between the ht48 & ht46 series mcus and the ht93lc46 eeprom  ha0004e ht48 & ht46 mcu uart software implementation method  ha0005e controlling the i2c bus with the ht48 & ht46 mcu series  ha0047e an pwm application example using the ht46 series of mcus
block diagram ht46r652 rev. 1.10 2 may 25, 2011         
            
    
     
    
        
 
   
        
                          ! "   #  $            %     %       &   '       '       (           ) "       ! *  "   '    +     % ,        ( -    %   % ,   ( .    ' *   &      /     /     0  %  0  / $  1  -  $  1       2    -    % $  1  -     '    ' * 3 "   -    " 4  - " 4  (  5 6 7 3 8  5 -    /  &     9 '      9 '      '     '    % -  &  % ,   5 -  &  5   % -  &  7 ,   5 -  &  / :     *  *   % - * ;  / - * ;    ( -  0    -    %  : -    %  6 -    /  5 -    /  * % -  % ,  * 5 -  5 7 <  # 

2 -  '  
+      /   4   4   - 4  0   4     4   4   - 4     4     4      (
pin assignment ht46r652 rev. 1.10 3 may 25, 2011        

     : -    %  * % -  %  * / -  /  *  -    * ( -  (  *  -    6 -    /  5 -    /  * : -  :  * 6 -  6  * 5 -  5 4  0 4   4       4     % -  &  7   / -  &  .    -  &  / %   ( -  &  / /    -  &  /    : -  &  / (   6 -  &  /    5 -  &  / :   ( .    ( -    %        /    %    / 4  4 / 4   4 "         5 -  &  5   6 -  &  6   : -  &  :    -  &     ( -  &  (    -  &     / -  &  /   % -  &  %   4     4     4     4     /    / :   / 6   / 5   / 7   / .    %    /        (        :    6    5    7    .   ( %   ( /   (    ( (   (    ( :   ( 6   ( 5   ( 7   / (   /    / /   / %   .   7   5   6   :      (      /   %        ( 4          /    % - * ;  / - * ;    ( -  0    -    % ( / (  ( ( (  ( : ( 6 ( 5 ( 7 ( .  %  /    (    :  6  5  7  . : % 7 / 7  7 (7 7 :7 67 57 77 .. %. /. . (. . :. 6. 5. 7. ./ % % 7 % 5 . 5 7 5 5 5 6 5 : 5  5 ( 5  5 / 5 % 6 . 6 7 6 5 6 6 6 : 6  6 ( 6  6 / 6 % : . : 7 : 5 : 6 : : :  : ( :  : / /  (  : 6 5 7 . / % / / /  / ( /  / : / 6 / 5 / 7 / .  %  /    (    :  6  5  7  . ( %
pin description pin name i/o options description pa0/bz pa1/bz pa2 pa3/pfd pa4/tmr0 pa5/int0 pa6/int1 pa7/tmr1 i/o wake-up pull-high buzzer pfd bidirectional 8-bit input/output port. each individual pin on this port can be configured as a wake-up input by a configuration option. software instruc - tions determine if the pin is a cmos output or schmitt trigger input. configu - ration options determine which pins on the port have pull-high resistors. pins pa0, pa1 and pa3 are pin-shared with bz, bz and pfd respectively. pins pa5, pa6, pa4 and pa7 are pin-shared with int0 , int1 , tmr0 and tmr1 respectively. pb0/an0~ pb7/an7 i/o pull-high bidirectional 8-bit input/output port. software instructions determine if the pin is a cmos output or schmitt trigger input. configuration options determine which pins on the port have pull-high resistors. pb is pin-shared with the a/d input pins. the a/d inputs are selected via software instructions. once a pb line is selected as an a/d input, the i/o function and pull-high resistor functions are disabled automatically. pc0/pwm0~ pc7/pwm7 i/o pull-high pwm bidirectional 8-bit input/output port. software instructions determine if the pin is a cmos output or schmitt trigger input. configuration options determine if all pins on the port have pull-high resistors. a configuration option deter - mines if all of the pins on this port are to be used as pwm outputs. individual pins cannot be selected to have a pwm function. pd0/pwm8~ pd7/pwm15 i/o pull-high pwm bidirectional 8-bit input/output port. software instructions determine if the pin is a cmos output or schmitt trigger input. configuration options determine which pins on the port have pull-high resistors. a configuration option for each pin on this port determines if each pin is to be used as a pwm output. vlcd i  lcd power supply vmax i  ic maximum voltage connect to vdd, vlcd or v1 v1, v2, c1, c2 i  voltage pump com0~com2 com3/seg40 o 1 / 3or1 / 4 duty seg40 can be set as a segment or as a common output driver for lcd panel by options. com0~com2 are outputs for the lcd panel. seg0~seg39 o logical output lcd driver outputs for the the lcd panel segments. seg0~seg23 can be configured as logical outputs via a configuration option. osc1 osc2 i o crystal or rc osc1 and osc2 are connected to an rc network or external crystal (deter - mined by a configuration option) for the internal system clock. if the rc sys - tem clock is selected, osc2 can be used to measure the system clock at 1 / 4 frequency. the system clock may also be sourced from the rtc oscillator, in which case these two pins can be left floating. osc3 osc4 i o rtc or system clock real time clock oscillator. osc3 and osc4 are connected to a 32768hz crystal oscillator for timing purposes or to form a system clock source, de - pending on configuration options. res i  schmitt trigger reset input, active low vdd  positive power supply avdd/vref analog positive power supply and a/d converter reference input voltage. pcvdd  port c positive power supply pdvdd  port d positive power supply vss/avss  negative power supply and analog negative power supply, ground pcvss  port c negative power supply, ground pdvss  port d negative power supply, ground note: individual pins on pc cannot be selected as a pwm output, if the pwm configuration option is selected for this port then all pins on pc will be setup as pwm outputs. ht46r652 rev. 1.10 4 may 25, 2011
absolute maximum ratings supply voltage ...........................v ss  0.3v to v ss +6.0v storage temperature ............................ 50 cto125 c input voltage..............................v ss  0.3v to v dd +0.3v operating temperature........................... 40 cto85 c i ol total ..............................................................300ma i oh total............................................................ 200ma total power dissipation .....................................500mw note: these are stress ratings only. stresses exceeding the range specified under  absolute maximum ratings  may cause substantial damage to the device. functional operation of this device at other conditions beyond those listed in the specification is not implied and prolonged exposure to extreme conditions may affect device reliability. d.c. characteristics ta=25 c symbol parameter test conditions min. typ. max. unit v dd conditions v dd operating voltage  f sys =4mhz 2.2  5.5 v  f sys =12mhz 3.3  5.5 v av dd analog operating voltage*  v ref =av dd 3.0  5.5 v i dd1 operating current (crystal osc) 3v no load, adc off f sys =4mhz  12ma 5v  35ma i dd2 operating current (rc osc) 3v no load, adc off f sys =4mhz  12ma 5v  35ma i dd3 operating current (crystal osc, rc osc) 5v no load, adc off f sys =12mhz  48ma i dd4 operating current (f sys =32768hz) 3v no load, adc off  0.3 0.6 ma 5v  0.6 1 ma i stb1 standby current (*f s =t1) 3v no load, system halt lcd off at halt  1 a 5v  2 a i stb2 standby current (*f s =32.768khz osc) 3v no load, system halt lcd on at halt, c type  2.5 5 a 5v  10 20 a i stb3 standby current (*f s =wdt rc osc) 3v no load, system halt lcd on at halt, c type  25 a 5v  610 a i stb4 standby current (*f s =32.768khz osc) 3v no load, system halt lcd on at halt, r type, 1 / 2 bias, vlcd=vdd (low bias current option)  17 30 a 5v  34 60 a i stb5 standby current (*f s =32.768khz osc) 3v no load, system halt lcd on at halt, r type, 1 / 3 bias, vlcd=vdd (low bias current option)  13 25 a 5v  28 50 a i stb6 standby current (*f s =wdt rc osc) 3v no load, system halt lcd on at halt, r type, 1 / 2 bias, vlcd=vdd (low bias current option)  14 25 a 5v  26 50 a i stb7 standby current (*f s =wdt rc osc) 3v no load, system halt lcd on at halt, r type, 1 / 3 bias, vlcd=vdd (low bias current option)  10 20 a 5v  19 40 a ht46r652 rev. 1.10 5 may 25, 2011
symbol parameter test conditions min. typ. max. unit v dd conditions v il1 input low voltage for i/o ports, tmr and int  0  0.3v dd v v ih1 input high voltage for i/o ports, tmr and int  0.7v dd  v dd v v il2 input low voltage (res )  0  0.4v dd v v ih2 input high voltage (res )  0.9v dd  v dd v v lvr low voltage reset voltage  2.7 3.0 3.3 v v lvd low voltage detector voltage  3.0 3.3 3.6 v i ol1 i/o port (pa, pb) and segment logic output sink current 3v v ol =0.1v dd 612  ma 5v 10 25  ma i oh1 i/o port (pa, pb) and segment logic output source current 3v v oh =0.9v dd 2 4  ma 5v 5 8  ma i ol2 i/o port (pc, pd) sink current 3v v ol =0.1v dd 10 20  ma 5v 25 40  ma i oh2 i/o port (pc, pd) source current 3v v oh =0.9v dd 10 20  ma 5v 25 40  ma i ol3 lcd common and segment current 3v v ol =0.1v dd 210 420  a 5v 350 700  a i oh3 lcd common and segment current 3v v oh =0.9v dd 80 160  a 5v 180 360  a r ph pull-high resistance of i/o ports 3v  20 60 100 k 5v  10 30 50 k v ad a/d input voltage  0  v ref v v ref adc input reference voltage range  av dd =3v 1.3  a vdd v av dd =5v 1.5  a vdd v dnl adc differential non-linear  
2 lsb inl adc integral non-linear  
2.5
4 lsb resolu resolution   12 bits i adc additional power consumption if a/d converter is used 3v   0.5 1 ma 5v  1.5 3 ma note: *f s  please refer to clock option of wdt * voltage level of av dd and v dd must be the same. ht46r652 rev. 1.10 6 may 25, 2011
a.c. characteristics ta=25 c symbol parameter test conditions min. typ. max. unit v dd conditions f sys1 system clock  2.2v~5.5v 400  4000 khz  3.3v~5.5v 400  12000 khz f sys2 system clock (32768hz crystal osc)  2.2v~5.5v  32768  hz f rtcosc rtc frequency   32768  hz f timer timer i/p frequency (tmr0/tmr1)  2.2v~5.5v 0  4000 khz  3.3v~5.5v 0  12000 khz t wdtosc watchdog oscillator period 3v  45 90 180 s 5v  32 65 130 s t res external reset low pulse width  1  s t sst system start-up timer period  power-up or wake-up from halt  1024  *t sys t lvr low voltage width to reset  0.25 1 2 ms t int interrupt pulse width  1  s t ad a/d clock period  1  s t adc a/d conversion time   80  t ad t adcs a/d sampling time   32  t ad note: *t sys = 1/f sys1 or 1/f sys2 ht46r652 rev. 1.10 7 may 25, 2011
ht46r652 rev. 1.10 8 may 25, 2011 functional description execution flow the system clock is derived from either a crystal or an rc oscillator or a 32768hz crystal oscillator. it is inter - nally divided into four non-overlapping clocks. one in - struction cycle consists of four system clock cycles. instruction fetching and execution are pipelined in such a way that a fetch takes one instruction cycle while de - coding and execution takes the next instruction cycle. the pipelining scheme makes it possible for each in - struction to be effectively executed in a cycle. if an in - struction changes the value of the program counter, two cycles are required to complete the instruction. program counter  pc the program counter, pc, is 13 bits wide and it controls the sequence in which the instructions stored in the program memory are executed. the contents of the pc can specify a maximum of 8192 addresses. after accessing a program memory word to fetch an in - struction code, the value of the pc is incremented by 1. the pc then points to the memory word containing the next instruction code. when executing a jump instruction, conditional skip ex - ecution, loading a pcl register, a subroutine call, an ini - tial reset, an internal interrupt, an external interrupt, or returning from a subroutine, the pc manipulates the program transfer by loading the address corresponding to each instruction. the conditional skip is activated by instructions. once the condition is met, the next instruction, fetched during the current instruction execution, is discarded and a dummy cycle replaces it to get a proper instruction; oth - erwise proceed to the next instruction.  /    (    /    (    /    (   0  # '     ' =   > ?  '     ' =   < / > 0  # '     ' =   @ / > ?  '     ' =   > 0  # '     ' =   @  > ?  '     ' =   @ / >     @ /   @   !   '  2   a     ' =   ' 
2 ! >   execution flow mode program counter *12 *11 *10 *9 *8 *7 *6 *5 *4 *3 *2 *1 *0 initial reset 0000000000000 external interrupt 0 0000000000100 external interrupt 1 0000000001000 timer/event counter 0 overflow 0000000001100 timer/event counter 1 overflow 0000000010000 time base interrupt 0000000010100 rtc interrupt 0000000011000 skip program counter+2 loading pcl *12 *11 *10 *9 *8 @7 @6 @5 @4 @3 @2 @1 @0 jump, call branch #12 #11 #10 #9 #8 #7 #6 #5 #4 #3 #2 #1 #0 return from subroutine s12 s11 s10 s9 s8 s7 s6 s5 s4 s3 s2 s1 s0 program counter note: *12~*0: program counter bits s12~s0: stack register bits #12~#0: instruction code bits @7~@0: pcl bits
ht46r652 rev. 1.10 9 may 25, 2011 the lower byte of the pc, known as pcl is a readable and writeable register. moving data into the pcl per - forms a short jump. the destination is within 256 loca - tions. when a control transfer takes place, an additional dummy cycle is required. program memory the program memory is used to store the program in - structions which are to be executed. it also contains data, table, and interrupt entries, and is organized into 8192 16 bits which are addressed by the program counter and table pointer. certain locations in the rom are reserved for special usage:  location 000h location 000h is reserved for program initialization. after a device reset, the program always begins exe - cution at this location.  location 004h location 004h is reserved for the external interrupt service program. if the int0 input pin is activated, and the interrupt is enabled, and the stack is not full, the program begins execution at location 004h.  location 008h location 008h is reserved for the external interrupt service program also. if the int1 input pin is activated, and the interrupt is enabled, and the stack is not full, the program begins execution at location 008h.  location 00ch location 00ch is reserved for the timer/event coun - ter 0 interrupt service program. if a timer interrupt re - sults from a timer/event counter 0 overflow, and if the interrupt is enabled and the stack is not full, the pro - gram begins execution at location 00ch.  location 010h location 010h is reserved for the timer/event coun - ter 1 interrupt service program. if a timer interrupt re - sults from a timer/event counter 1 overflow, and if the interrupt is enabled and the stack is not full, the pro - gram begins execution at location 010h.  location 014h location 014h is reserved for the time base interrupt service program. if a time base interrupt occurs, and the interrupt is enabled, and the stack is not full, the program begins execution at location 014h.  location 018h location 018h is reserved for the real time clock inter - rupt service program. if a real time clock interrupt oc - curs, and the interrupt is enabled, and the stack is not full, the program begins execution at location 018h.  table location any location in the program memory can be used as a look-up table. the instructions  tabrdc [m] (the current page, 1 page=256 words) and  tabrdl [m] (the last page) transfer the contents of the lower-order byte to the specified data memory, and the contents of the higher-order byte to tblh which is the table higher-order byte register. only the destination of the lower-order byte in the table is well-defined; the other bits of the table word are all transferred to the lower portion of tblh. the tblh register is read only, and the table pointer, tblp, is a read/write register, indi - cating the table location. before accessing the table, the location should be placed in tblp. all the table re - lated instructions require 2 cycles to complete the op - eration. these areas may function as a normal program memory depending upon the user s require - ments.  +   ' 
   2  8   
'        ? 
 2 ' 
   ' % '  b   
    - +
'  
 ' % ' 
   '  b   
/ 6 ' b              ! "   a <  '  b 2 ' =  : 6 ' c     >   d '
'  
  ' $    ' % '  ' / 0 ? 
 2 ' 
   ' / '  b   
   ' *   ' 
      ' 
   "   a <  '  b 2 ' =  : 6 ' c     >     - +
'  
 ' / ' 
   '  b   
% % % 3 % %  3 % % 7 3 % /  3 / 0 0 0 3 % / 7 3 % %  3
% % 3
0 0 3 % / % 3 program memory instruction(s) table location *12 *11 *10 *9 *8 *7 *6 *5 *4 *3 *2 *1 *0 tabrdc [m] p12 p11 p10 p9 p8 @7 @6 @5 @4 @3 @2 @1 @0 tabrdl [m] 1 1 1 1 1 @7 @6 @5 @4 @3 @2 @1 @0 table location note: *12~*0: table location bits p12~p8: current program counter bits @7~@0: table pointer bits
ht46r652 rev. 1.10 10 may 25, 2011 stack register  stack the stack register is a special part of the memory used to save the contents of the program counter. the stack is organized into 16 levels and is neither part of the data nor part of the program, and is neither readable nor writeable. its activated level is indexed by a stack pointer, sp, which is neither readable nor writeable. at the start of a subroutine call or an interrupt acknowledg - ment, the contents of the program counter is pushed onto the stack. at the end of the subroutine or interrupt routine, signaled by a return instruction, ret or reti, the contents of the program counter is restored to its previous value from the stack. after a device reset, the sp will point to the top of the stack. if the stack is full and a non-masked interrupt takes place, the interrupt request flag is recorded but the ac - knowledgment is still inhibited. once the sp is decre - mented, by ret or reti, the interrupt will be serviced. this feature prevents a stack overflow, allowing the pro - grammer to use the structure easily. likewise, if the stack is full, and a call is subsequently executed, a stack overflow occurs and the first entry is lost as only the most recent sixteen return addresses are stored. data memory  ram the data memory has a structure of 431  8 bits, and is divided into two functional groups, namely the special function registers, 47  8 bits, and the general purpose data memory, bank0: 192  8 bits and bank2: 192 8 bits most of which are readable/writeable, although some are read only. the special function registers are over- lapped in every bank. any unused remaining space before 40h is reserved for future expanded usage and if read will return a 00h value. the data memory space before 40h will overlap in each bank. the general purpose data memory, addressed from 40h to ffh (bank0; bp=0 or bank2; bp=2), is used for data and control information under instruction commands. all of the data memory areas can handle arithmetic, logic, increment, decrement and rotate operations directly. except for some dedicated bits, each bit in the data memory can be set and reset by  set [m].i and clr [m].i . they are also indirectly accessible through mem - ory pointer registers, mp0 and mp1. after first setting up bp to the value of 01h or 02h to access either bank 1 or bank 2 respectively, these banks must then be accessed indirectly using the memory pointer mp1. with bp set to a value of either 01h or 02h , using mp1 to indirectly read or write to the data memory areas with addresses from 40h~ffh, will re - sult in operations to either bank 1 or bank 2. directly ad - dressing the data memory will always result in bank 0 being accessed irrespective of the value of bp.      2 '         '     ! 
    '      
 '      ' %   % 
    '      
 '      ' /   / *      "  * "   * " 3              %    % 3    % "    %     / 3    / "    /      *  *             &  %  &  /  &    &  (     /  &    &  :  &  6  &  5   "   3        &  7  &  .  &  / %  &  / /  &  /   &  / (  &  /   &  / : d ' 
     '   ' e % % e 
  2 '         '     ! = ( 7  ' * !  > 0 0 3  % 3 ( 0 3 % % 3 % / 3 %  3 % ( 3 %  3 % : 3 % 6 3 % 5 3 % 7 3 % . 3 % 3 % * 3 %  3 %  3 % 3 % 0 3 / % 3 / / 3 /  3 / ( 3 /  3 / : 3 / 6 3 / 5 3 / 7 3 / . 3 / 3 / * 3 /  3 /  3 / 3 / 0 3  % 3  / 3   3  ( 3   3  : 3  6 3  5 3  7 3  . 3  3  * 3   3   3  3  0 3 ram mapping
ht46r652 rev. 1.00 11 december 19, 2006 indirect addressing register locations 00h and 02h are for indirect addressing reg - isters that are not physically implemented. any read/write operation to locations [00h] and [02h] ac - cesses the data memory locations pointed to by mp0 and mp1 respectively. reading location 00h or 02h in - directly will return a result of 00h. writing indirectly will lead to no operation. the function of data movement between two indirect ad - dressing registers is not supported. the memory pointer registers, mp0 and mp1, are both 8-bit registers used to access the data memory by combining corresponding indirect addressing registers. mp0 can only be applied to the data memory, while mp1 can be applied to both the data memory and the lcd display memory. accumulator  acc the accumulator, acc, is related to the alu operations. it is also mapped to location 05h in the data memory and is capable of operating with immediate data. the data movement between two data memory locations must pass through the acc. arithmetic and logic unit  alu this circuit performs 8-bit arithmetic and logic opera - tions and provides the following functions:  arithmetic operations - add, adc, sub, sbc, daa  logic operations - and, or, xor, cpl  rotation - rl, rr, rlc, rrc  increment and decrement - inc, dec  branch decision - sz, snz, siz, sdz etc. the alu not only saves the results of a data operation but also changes the status register. status register  status the status register is 8 bits wide and contains, a carry flag (c), an auxiliary carry flag (ac), a zero flag (z), an overflow flag (ov), a power down flag (pdf), and a watchdog time-out flag (to). it also records the status information and controls the operation sequence. except for the to and pdf flags, bits in the status reg - ister can be altered by instructions similar to other reg - isters. data written into the status register does not alter the to or pdf flags. operations related to the status register, however, may yield different results from those intended. the to and pdf flags can only be changed by a watchdog timer overflow, a device power-up, or clearing the watchdog timer and executing the  halt instruction. the z, ov, ac, and c flags reflect the status of the latest operations. on entering the interrupt sequence or executing a sub - routine call, the status register will not be automatically pushed onto the stack. if the contents of the status is im - portant, and if the subroutine is likely to corrupt the sta - tus register, the precautions should be taken to save it properly. interrupts the device provides two external interrupts, two internal timer/event counter interrupts, an internal time base in- terrupt and an internal real time clock interrupt. the in- terrupt control register 0, intc0, and the interrupt control register 1, intc1, both contain the interrupt con- trol bits that are used to set the enable/disable status and interrupt request flags. once an interrupt subroutine is serviced, other inter- rupts are all blocked as the emi bit is automatically cleared, which may prevent any further interrupt nest - ing. other interrupt requests may take place during this interval, but only the interrupt request flag will be re - corded. if a certain interrupt requires servicing within the bit no. label function 0c c is set if an operation results in a carry during an addition operation or if a borrow does not take place during a subtraction operation; otherwise c is cleared. c is also affected by a ro - tate through carry instruction. 1ac ac is set if an operation results in a carry out of the low nibbles in addition or no borrow from the high nibble into the low nibble in subtraction; otherwise ac is cleared. 2 z z is set if the result of an arithmetic or logic operation is zero; otherwise z is cleared. 3ov ov is set if an operation results in a carry into the highest-order bit but not a carry out of the highest-order bit, or vice versa; otherwise ov is cleared. 4 pdf pdf is cleared by either a system power-up or executing the  clr wdt instruction. pdf is set by executing the halt instruction. 5to to is cleared by a system power-up or executing the  clr wdt or halt instruction. to is set by a wdt time-out. 6, 7  unused bit, read as 0 status (0ah) register
ht46r652 rev. 1.10 12 may 25, 2011 service routine, the emi bit and the corresponding bit of intc0 or of intc1 may be set in order to allow interrupt nesting. if the stack is full, the interrupt request will not be acknowledged, even if the related interrupt is en - abled, until the stack pointer is decremented. if immedi - ate service is desired, the stack should be prevented from becoming full. all these interrupts will generate a wake-up function. as an interrupt is serviced, a control transfer occurs by pushing the contents of the program counter onto the stack followed by a branch to a subroutine at the speci - fied location in the program memory. only the contents of the program counter is pushed onto the stack. if the contents of the register or of the status register is altered by the interrupt service program which corrupts the de - sired control sequence, the contents should be saved in advance. external interrupts are triggered by a an edge transition on int0 or int1 , when the related interrupt request flag, eif0; bit 4 of intc0, eif1; bit 5 of intc0, is set. the trigger edge type, high to low, low to high, or both low to high and or high to low is determined by configuration option. after the interrupt is enabled, if the stack is not full, and the external interrupt is active, a subroutine call to location 04h or 08h occurs. the interrupt request flag, eif0 or eif1, and emi bits are all cleared to disable other maskable interrupts. the internal timer/event counter 0 interrupt is initial - ised by setting the timer/event counter 0 interrupt re - quest flag, t0f; bit 6 of intc0, which is normally caused by a timer overflow. after the interrupt is enabled, and if the stack is not full, and the t0f bit is set, a subroutine call to location 0ch occurs. the related interrupt re - quest flag, t0f, is reset, and the emi bit is cleared to dis - able other maskable interrupts. timer/event counter 1 is operated in the same manner but its related interrupt request flag is t1f, bit 4 of intc1, and its subroutine call location is 10h. the time base interrupt is initialised by setting the time base interrupt request flag, tbf; bit 5 of intc1, that is caused by a regular time base signal. after the interrupt is enabled, and the stack is not full, and the tbf bit is set, a subroutine call to location 14h occurs. the related interrupt request flag, tbf, is reset and the emi bit is cleared to disable further maskable interrupts. the real time clock interrupt is initialised by setting the real time clock interrupt request flag, rtf; bit 6 of intc1, that is caused by a regular real time clock signal. after the interrupt is enabled, and the stack is not full, and the rtf bit is set, a subroutine call to location 18h occurs. the re - lated interrupt request flag, rtf, is reset and the emi bit is cleared to disable further maskable interrupts. bit no. label function 0 emi controls the master (global) interrupt (1=enabled; 0=disabled) 1 eei0 controls the external interrupt 0 (1=enabled; 0=disabled) 2 eei1 controls the external interrupt 1 (1=enabled; 0=disabled) 3 et0i controls the timer/event counter 0 interrupt (1=enabled; 0=disabled) 4 eif0 external interrupt 0 request flag (1=active; 0=inactive) 5 eif1 external interrupt 1 request flag (1=active; 0=inactive) 6 t0f internal timer/event counter 0 request flag (1=active; 0=inactive) 7  for test mode used only. must be written as 0 ; otherwise may result in unpredictable operation. intc0 (0bh) register bit no. label function 0 et1i controls the timer/event counter 1 interrupt (1=enabled; 0=disabled) 1 etbi controls the time base interrupt (1=enabled; 0:disabled) 2 erti controls the real time clock interrupt (1=enabled; 0:disabled) 3, 7  unused bit, read as 0 4 t1f internal timer/event counter 1 request flag (1=active; 0=inactive) 5 tbf time base request flag (1=active; 0=inactive) 6 rtf real time clock request flag (1=active; 0=inactive) intc1 (1eh) register
ht46r652 rev. 1.00 13 december 19, 2006 during the execution of an interrupt subroutine, other maskable interrupt acknowledgments are all held until the  reti instruction is executed or the emi bit and the related interrupt control bit are set both to 1 (if the stack is not full). to return from the interrupt subrouti ne,a  ret or  reti instruction may be executed. reti sets the emi bit and enables an interrupt service, but ret does not. interrupts occurring in the interval between the rising edges of two consecutive t2 pulses are serviced on the latter of the two t2 pulses if the corresponding interrupts are enabled. in the case of simultaneous requests, the priorities in the following table apply. these can be masked by resetting the emi bit. interrupt source priority vector external interrupt 0 1 04h external interrupt 1 2 08h timer/event counter 0 overflow 3 0ch timer/event counter 1 overflow 4 10h time base interrupt 5 14h real time clock interrupt 6 18h the emi, eei0, eei1, et0i, et1i, etbi, and erti bits are all used to control the enable/disable status of the in- terrupts. these bits prevent the requested i nterrupt from being serviced. once the interrupt request flags, rtf, tbf, t0f, t1f, eif1, eif0 are set, they remain in the intc1 or intc0 register respectively until the interrupts are serviced or cleared by a software instruction. it is recommended that a program should not use a call instruction w ithin the interrupt subroutine. this is because interrupts often occur in an unpredictable man - ner or require to be serviced immediately in some appli - cations. during that period, if only one stack is left, and enabling the interrupt is not well controlled, execution of a  call in the interrupt subroutine may damage the original control sequence. oscillator configuration the device provides three oscillator circuits for the sys - tem clock, namely an rc oscillator, a crystal oscillator and an rtc 32768hz crystal oscillator, the choice of which is determined by configuration option. when the device enters the power down mode, the rc or crystal oscillator will cease running to conserve power. the 32768hz crystal oscillator, however, will keep running when the device is in the power down mode. if the 32768hz crystal oscillator is selected as the system os - cillator, when the device enters the power down mode, the system oscillator keeps running, but instruction exe - cution will cease. since the 32768hz oscillator is also designed for timing purposes, the internal timing func - tions, rtc, time base and wdt, continue to operate even when the system enters the power down mode. if the rc oscillator is used, an external resistor con - nected between pins osc1 and vss is required, whose value should range from 24k to 1m . the system clock, divided by 4, can be monitored on pin osc2 if a pull-high resistor is connected. this pin can be used to synchro - nise external logic. the rc oscillator provides the most cost effective solution. however, as the frequency may vary with vdd, temperature, and process variations, it is therefore not suitable for timing sensitive operations where an accurate oscillator frequency is desired. if a crystal oscillator is selected, a crystal across osc1 and osc2 is needed to provide the feedback and phase shift required for the oscillator, and no other external components are required. a resonator may be connected between osc1 and osc2 to replace the crystal and to get a frequency reference, but two external capacitors between osc1 and osc2 and ground are required. the other oscillator circuit, which is a real time clock, re- quires a 32768hz crystal oscillator to be connected be- tween osc3 and osc4. the rtc oscillator circuit can be controlled to start-up quickly by setting the qosc bit, which is bit 4 of rtcc. it is recommended to turn on the quick start-up function during power on, and then turn it off again after 2 seconds. the wdt oscillator is a free running on-chip rc oscilla - tor, which does not require external components. al - though when the system enters the power down mode and the system clock stops, the wdt oscillator still oper - ates with a nominal period of approximately 65  sat5v. the wdt oscillator can be disabled by a configuration option to conserve power.   !   2 '     2 2      '     2 2       /    /     $  1  -      (  5 6 7 3 8 '   !   2 -    '     2 2       (     4    5 %  0 system oscillator note: *32768hz crystal enable condition: for wdt clock source or for system clock source.
ht46r652 rev. 1.10 14 may 25, 2011 watchdog timer  wdt the wdt clock source is implemented by a dedicated rc oscillator (wdt oscillator) or an instruction clock (system clock/4) or a real time clock oscillator (rtc os - cillator). the timer is designed to prevent a software malfunction or sequence from jumping to an unknown location with unpredictable results. the wdt can be disabled by options. but if the wdt is disabled, all exe - cutions related to the wdt lead to no operation. if the internal wdt oscillator, which is an rc oscillator with a nominal period of 65  s at 5v, is selected, it is di - vided by 2 12 ~2 15 , the actual ratio chosen by configura - tion option, to get the wdt time-out period. the minimum period for the wdt time-out period is about 300ms~600ms. this time-out period may vary with tem - perature, vdd and process variations. by selection the wdt configuration option, longer time-out periods can be realised. if the wdt time-out is selected as 2 15 , the maximum time-out period is divided by 2 15 ~2 16 about 2.1s~4.3s. if the wdt oscillator is disabled, the wdt clock may still come from the instruction clock and oper - ate in the same manner except that in the power down mode the wdt will stop counting and lose its protecting function. if the device operates in a noisy environment, using the wdt internal rc oscillator is strongly recom - mended, since the halt instruction will stop the system clock. the wdt overflow under normal operation initiates a de- vice reset which sets the status bit  to  . in the power down mode, the overflow initiates a warm reset, in which only the program counter and stack pointer are reset to zero. to clear the contents of the wdt, there are three methods that can be adopted. these are, an external re- set, which is a low level on the res pin, a software in- struction and a  halt  instruction. there are two types of software instructions; a single  clr wdt  instruction or the pair of instructions,  clr wdt1  and  clr wdt2  . of these two types of instruction, only one type of instruc - tion can be active at a time depending on a configuration option  clr wdt  times selection option. if the  clr wdt is selected (i.e., clr wdt times equal one), any execution of the  clr wdt  instruction clears the wdt. in the case where the two  clr wdt1  and  clr wdt2 instruction are chosen (i.e., clr wdt times equal two), these two instructions have to be executed to clear the wdt; otherwise, the wdt may reset the chip due to a time-out. multi-function timer the device provides a multi-function timer for the wdt, time base and rtc but with different time-out periods. the multi-function timer consists of an 8-stage divider and a 7-bit prescaler, with the clock source coming from the wdt osc, the rtc osc or the instruction clock, which is the system clock divided by 4. the multi-func - tion timer also provides a selectable frequency signal, whose division ratio ranges from f s /2 2 to f s /2 8 , for lcd driver circuits, and a selectable frequency signal, rang - ing from f s /2 2 to f s /2 9 , for the buzzer output selectable via configuration options. it is recommended to select a frequency as close as possible to 4khz for the lcd driver circuits to obtain the best display clarity. time base the time base offers a periodic time-out period to gener- ate a regular internal interrupt. its time-out period ranges from 2 12 /f s to 2 15 /f s selected by a configuration option. if a time base time-out occurs, the related inter- rupt request flag, tbf; bit 5 of intc1, will be set. if the interrupt is enabled, and the stack is not full, a subrou - tine call to location 14h occurs.  !   '  2   a -    +             
&      /  a 3 8       (  5 6 7 3 8     $  $  -  7    <  '    / : - $  ,  / 6 - $   /  - $  ,  / : - $   / ( - $  ,  /  - $   /  - $  ,  / ( - $  &        2     a '    
&   '  2    )  ) watchdog timer ' ' ' ' ' ' ' ' $    +         2     '    '    
"   '    +  ' = $  -   , $  -  7 > * 8 8  ' = $  -   , $  -  . >    ' *   ' 
    /  - $  ,  / : - $           
time base
ht46r652 rev. 1.10 15 may 25, 2011 real time clock  rtc the real time clock, rtc, is operated in the same man - ner as the time base in that it is used to supply a regular internal interrupt. its time-out period ranges from f s /2 8 to f s /2 15 , the value being setup using software. writing data to the rt2, rt1 and rt0 bits in the rtcc register, provides various time-out periods. if an rtc time-out occurs, the related interrupt request flag, rtf; bit 6 of intc1, is set. but if the interrupt is enabled, and the stack is not full, a subroutine call to location 18h occurs. rt2 rt1 rt0 rtc clock divided factor 000 2 8 * 001 2 9 * 010 2 10 * 011 2 11 * 100 2 12 101 2 13 110 2 14 111 2 15 note: * not recommended to be used power down operation the power down mode is entered by the execution of a  halt instruction and results in the following.  the system will cease to run but the wdt oscillator will keep running if the wdt oscillator or the real time clock is selected.  the contents of the memory and registers remain un- changed.  the wdt will be cleared and starts recounting, if the wdt clock source is sourced from the wdt oscillator or the real time clock oscillator.  all i/o ports maintain their original status.  the pdf flag is set but the to flag is cleared.  the lcd driver will maintain its function if the wdt osc or rtc osc is selected. the system will wake up from the power down mode via an external reset, an interrupt, an external falling edge signal on port a or a wdt overflow. an external reset will generate a device initialisation, while a wdt overflow performs a  warm reset . after examining the to and pdf flags, the reason for the device reset can be deter - mined. the pdf flag is cleared by a system power-up or by executing the  clr wdt instruction, and is set by executing the halt instruction. the to flag is set if a wdt time-out occurs, and causes a wake-up that only resets the program counter and the stack pointer, but leaves the others in their original state. the port a wake-up and interrupt methods can be con - sidered as a continuation of normal execution. each bit in port a can be independently selected to wake up the device by a configuration option. if awakened by an i/o port stimulus, the program resumes execution at the next instruction following the  halt instruction. awak - ening from an interrupt, two sequence may occur. if the related interrupt is disabled or the interrupt is enabled but the stack is full, the program resumes execution at the next instruction. but if the interrupt is enabled, and the stack is not full, a regular interrupt response takes place. when an interrupt request flag is set before entering the power down mode, the system cannot be awakened us - ing that interrupt. if a wake-up events occur, it takes 1024 t sys (system clock periods) to resume normal operation. in other words, a dummy period is inserted after the wake-up. if the wake-up results from an interrupt acknowledgment, the actual interrupt subroutine execution is delayed by more than one cycle. however, if a wake-up results in the next instruction execution, the execution will be per- formed immediately after the dummy period is finished. to minimise power consumption, all the i/o pins should be carefully managed before entering the power down mode. reset there are three ways in which a reset may occur.  res pin is pulled low during normal operation  res pin is pulled low when in the power down mode  a wdt time-out during normal operation a wdt time-out when the device is in the power down mode differs from other device reset conditions, as it will perform a  warm reset that resets only the program counter and the sp but leaves the other circuits in their original state. some registers remain unaffected during other reset conditions. most registers are reset to their initial condition once the reset conditions are met. by ex - amining the pdf and to flags, the program can distin - guish between the different types of device resets.   +    ' ' ' ' ' ' ' ' $  7 '  ' /  ? f      2       /   %    ' 
    7 - $  ,  / : - $  real time clock
ht46r652 rev. 1.10 16 may 25, 2011 to pdf reset conditions 0 0 res reset during power-up u u res reset during normal operation 0 1 res wake-up 1 u wdt time-out during normal operation 1 1 wdt wake-up note: u stands for unchanged to guarantee that the system oscillator is started and stabilised, the sst (system start-up timer) provides an extra-delay of 1024 system clock pulses when the sys - tem awakes from the power down mode or during a power up. when awakened from the power down mode or during a system power-up, the sst delay will be added. an extra sst delay is added during the power-up pe - riod, and any wake-up from the power down mode may enable only the sst delay. the following table shows how various components of the microcontroller are affected after a power-on reset occurs. program counter 000h interrupt disabled prescaler, divider cleared wdt, rtc, time base cleared. after master reset, wdt starts counting timer/event counter off input/output ports input mode stack pointer points to the top of the stack   4   / % % a  / % a  % f /  0 g % f % /  0 g reset circuit note: * make the length of the wiring, which is con - nected to the res pin as short as possible, to avoid noise interference.   4      '    <   #   ' '      @    reset timing chart &   3 "  &      <    ? 
 2     2      c  < 
'    
   / % < b  '     2  
    / &    '   reset configuration
ht46r652 rev. 1.10 17 may 25, 2011 the register states are summarised in the following table: register reset (power on) wdt time-out (normal operation) res reset (normal operation) res reset (halt) wdt time-out (halt)* tmr0h xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu tmr0l xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu tmr0c 00-0 1000 00-0 1000 00-0 1000 00-0 1000 uu-u uuuu tmr1h xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu tmr1l xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu tmr1c 0000 1--- 0000 1--- 0000 1--- 0000 1--- uuuu u--- program counter 0000h 0000h 0000h 0000h 0000h mp0 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu mp1 xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu bp 0000 0000 0000 0000 0000 0000 0000 0000 uuuu uuuu acc xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu tblp xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu tblh xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu status --00 xxxx --1u uuuu --uu uuuu --01 uuuu --11 uuuu intc0 -000 0000 -000 0000 -000 0000 -000 0000 -uuu uuuu intc1 -000 -000 -000 -000 -000 -000 -000 -000 -uuu -uuu rtcc --00 0111 --00 0111 --00 0111 --00 0111 --uu uuuu pa 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pac 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pb 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pbc 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pc 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pcc 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pd 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pdc 1111 1111 1111 1111 1111 1111 1111 1111 uuuu uuuu pwm0~ pwm15 xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu adrl xxxx ---- xxxx ---- xxxx ---- xxxx ---- uuuu ---- adrh xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx uuuu uuuu adcr 0100 0000 0100 0000 0100 0000 0100 0000 uuuu uuuu acsr ---- --00 ---- --00 ---- --00 ---- --00 ---- --uu note: * stands for warm reset u stands for unchanged x stands for unknown
ht46r652 rev. 1.10 18 may 25, 2011 timer/event counter two timer/event counters, timer/event counter 0 and timer/event counter,1 are implemented within the microcontroller. timer/event counter 0 is a 16-bit pro - grammable count-up counter whose clock may come from an external or internal source. the internal clock source will come from f sys . timer/event counter 1 is also a 16-bit programmable count-up counter whose clock may come from an external source or an internal source. the internal clock source comes from f sys /4 or a 32768hz source, selected by a configuration option. the external clock input allows the user to count exter - nal events, measure time intervals or pulse widths, or to generate an accurate time base. there are three registers associated with timer/event counter 0; tmr0h, tmr0l and tmr0c, and another three for timer/event counter 1; tmr1h, tmr1l and tmr1c. writing to tmr0l and tmr1l will only put the written data into an internal lower-order byte buffer (8-bit) while writing to tmr0h and tmr1h will transfer the specified data and the contents of the lower-order byte buffer to the tmr0h/tmr1h and tmr0l/tmr1l registers. the timer/event counter 0/1 preload register is changed with each tmr0h/tmr1h write operations. reading tmr0h/tmr1h will latch the contents of tmr0h/tmr1h and tmr0l/tmr1l counters to the destination and the lower-order byte buffer, respec - tively. reading tmr0l/tmr1l will only read the con - tents of the lower-order byte buffer. the tmr0c and tmr1c registers are the timer/event counter control registers, which control the operating mode, the timer enable or disable and the active edge type. the t0m0, t0m1 and t1m0, t1m1 bits define the timer operational mode. the event count mode is used to count external events, which requires that the clock source comes from an external tmr0 or tmr1 pin. the timer mode functions as a normal timer with the clock source coming from the internally selected clock source. the pulse width measurement mode can be used to count the high or low level duration of an external signal on pin tmr0 or tmr1, with the count value based on the internally selected clock source. in the event count or timer mode, the timer/event coun - ter starts counting from the current contents in the  %  /  %  %    %  %  %  /  %  %  %    2  ' &   #     
   '  
  2 7 <    '      2  7 < / '    $  1  $     %     ,  %    % / 6 < *    2    '         ' *   2     +  $ 2  c '  ' 
   "  c ' * ! * $ $  3   # ' * ! "  c ' * ! / 6 < *  '     - +
'  
  0  % timer/event counter 0  /  /  /  %    /  /  /  /  /  %  /    2  ' &   #     
   '  
  2 $    $  1  -  (  5 6 7 3 8  /     / 6 < *    2    '         ' *   2     +  $ 2  c '  ' 
   "  c ' * ! * $ $  3   # ' * ! "  c ' * ! / 6 < *  '     - +
'  
  0  / timer/event counter 1    / -   0   0  '     '    
 ( '    '    "  0  %  0  / pfd source option
ht46r652 rev. 1.10 19 may 25, 2011 timer/event counter and ends at ffffh. once an over - flow occurs, the counter is reloaded from the timer/event counter preload register, and generates an interrupt re - quest flag, t0f; bit 6 of intc0 and t1f; bit 4 of intc1. in the pulse width measurement mode with the values of the t0on/t1on and t0e/t1e bits equal to 1, after the tmr0 or tmr1 pin has received a transient from low to high, or high to low if the t0e/t1e bit is 0 , it will start counting until the tmr0 or tmr1 pin returns to its origi - nal level and resets the t0on/t1on bit. the measured result remains in the timer/event counter even if the acti - vated transient occurs again. in other words, only a sin - gle measurement can be made until the t0on/t1on is again set. in this operation mode, the timer/event coun - ter begins counting, not according to the logic level on the pins, but according to the transient edges. in the case of counter overflows, the counter is reloaded from the timer/event counter register and issues an interrupt request, as in the other two modes, i.e., event and timer modes. bit no. label function 0 1 2 t0psc0 t0psc1 t0psc2 to define the prescaler stages. t0psc2, t0psc1, t0psc0= 000: f int =f sys 001: f int =f sys /2 010: f int =f sys /4 011: f int =f sys /8 100: f int =f sys /16 101: f int =f sys /32 110: f int =f sys /64 111: f int =f sys /128 3 t0e defines the tmr0 active edge of the timer/event counter: in event counter mode (t0m1,t0m0)=(0,1): 1: count on falling edge; 0: count on rising edge in pulse width measurement mode (t0m1,t0m0)=(1,1): 1: start counting on the rising edge, stop on the falling edge; 0: start counting on the falling edge, stop on the rising edge 4 t0on enable/disable timer counting (0=disabled; 1=enabled) 5  unused bit, read as 0 6 7 t0m0 t0m1 defines the operating mode t0m1, t0m0= 01= event count mode (external clock) 10= timer mode (internal clock) 11= pulse width measurement mode (external clock) 00= unused tmr0c (0eh) register bit no. label function 0~2  unused bit, read as 0 3 t1e defines the tmr1 active edge of the timer/event counter: in event counter mode (t1m1,t1m0)=(0,1): 1: count on falling edge; 0: count on rising edge in pulse width measurement mode (t1m1,t1m0)=(1,1): 1: start counting on the rising edge, stop on the falling edge; 0: start counting on the falling edge, stop on the rising edge 4 t1on enable/disable timer counting (0= disabled; 1= enabled) 5 t1s defines the tmr1 internal clock source (0=f sys /4; 1=32768hz) 6 7 t1m0 t1m1 defines the operating mode t1m1, t1m0= 01= event count mode (external clock) 10= timer mode (internal clock) 11= pulse width measurement mode (external clock) 00= unused tmr1c (11h) register
ht46r652 rev. 1.10 20 may 25, 2011 to enable a counting operation, the timer on bit, t0on or t1on should be set to 1. in the pulse width measure - ment mode, the t0on/t1on is automatically cleared after the measurement cycle is completed. but in the other two modes, the t0on/t1on can only be reset by instructions. the overflow of the timer/event counter 0/1 is one of the wake-up sources and can also be used to drive the pfd (programmable frequency divider) output on pin pa3, a function which is selected by a configuration option. if pa3 is setup as a pfd output, there are two types of selections. one is to use pfd0 as the pfd output, the other is to use pfd1 as the pfd output. pfd0 and pfd1 are the timer overflow signals of the timer/event counter 0 and timer/event counter 1 respectively. no matter what the operation mode is, writin ga0to et0i or et1i disables the related interrupt service. when the pfd function is selected, executing a  set [pa].3 instruction will enable the pfd output and executing a  clr [pa].3 instruction will disable the pfd output. in cases where the timer/event counter is turned off, writing data to the timer/event counter preload register will also reload the new data into the timer/event coun - ter. but if the timer/event counter is turned on, data writ - ten to the timer/event counter will only be stored in the timer/event counter preload register. the timer/event counter will continue with its normal operation until an overflow occurs. when the timer/event counter is read, the clock is blocked to avoid errors, which may result in a counting error and should therefore be taken into account by the programmer. it is strongly recommended to load a de- sired value into the timer registers first before turning on the related timer/event counter, for proper operation since the initial value of the timer registers is unknown. due to the timer/event counter scheme, the program - mer should pay special attention with instructions to en - able then disable the timer for the first time, whenever there is a need to use the timer/event counter function, to avoid unpredictable results. after this procedure, the timer/event function can be operated normally. bits 0~2 of tmr0c can be used to define the pre-scaling stages of the internal clock sources of the timer/event counter. the overflow signal of the timer/event counter can be used to generate the pfd signal. the timer prescaler is also used as the the pwm counter. input/output ports there are 32 bidirectional input/output lines in the microcontroller, divided among several ports labeled as pa, pb, pc and pd. all of these i/o ports can be used for input and output operations. for input operation, these ports are non-latching, that is, the inputs must be ready at the t2 rising edge of instruction  mov a,[m]  . for output operations, all the data is latched and re - mains unchanged until the output latch is rewritten. each port has has its own port control register, known as pac, pbc, pcc and pdc to control the input/output con - figuration. with this control register, a cmos output or schmitt trigger input with or without pull-high resistor structures can be reconfigured dynamically under soft - ware control. to function as an input, the corresponding bit of the control register must contain a  1  . the input source also depends on the control register. if the control register bit is  1  , the input will read the pad state. if the control reg - ister bit is  0  , the contents of the latches will move to the internal bus. the latter is possible in the  read-mod - ify-write instruction. after a device reset, as the port control registers will be set high, the input/output lines will be setup as inputs, and will be at a high level or in a floating state, depend - ing on the pull-high configuration options. each bit of these input/output latches can be set or cleared by the  set [m].i and  clr [m].i instructions. some instructions first input data and then follow the output operations. for example,  set [m].i  ,  clr [m].i,  cpl [m] , cpla [m] read the entire port states into the cpu, execute the defined operations (bit-opera - tion), and then write the results back to the latches or the accumulator. each line of port a has the capability of waking-up the device. each i/o port has pull-high options. once the pull-high option is selected, the i/o port has a pull-high resistor. it should be noted that a non-pull-high i/o port operating in an input mode will be in a floating condition. pin pa3 is pin-shared with the pfd signal. if the pfd configuration option is selected, the output signal for pa3, if it setup as an output, will be the pfd signal gen- erated by the timer/event counter overflow signal. if setup as an input the pa3 will always retain its input function. once the pfd configuration option is selected, the pfd output signal can be controlled by the pa3 data register. writing a 1 to the pa3 data register will enable the pfd output function while writing a   will force the pa3 pin to remain in a low condition. the i/o functions of the pa3 pin are shown in the table. i/o mode i/p (normal) o/p (normal) i/p (pfd) o/p (pfd) pa3 logical input logical output logical input pfd (timer on) note: the pfd frequency is the timer/event counter overflow frequency divided by 2. pins pa0, pa1, pa3, pa5, pa6, pa4 and pa7 are pin-shared with the bz, bz , pfd, int0 , int1 , tmr0 and tmr1 pins respectively. the pa0 and pa1 pins are pin-shared with the bz and bz signal, respectively. if the bz/bz option is selected, the output signal in the output mode of pa0/pa1 will be the buzzer signal, which is generated by the multi-func -
ht46r652 rev. 1.10 21 may 25, 2011 tion timer. if the pins are setup as inputs then they will al - ways retain their input function. once the bz/bz configuration option is selected, the buzzer output sig- nal is controlled by the pa0/pa1 data register. the pa0/pa1 pins i/o functions are shown in the table. pa0i/o i i oooooooo pa1i/o i o i i i ooooo pa0 mode x x c b b c bbbb pa1 mode x c x x x c c c b b pa0 data x x d 0 1 d 0 0101 pa1 data x d x x x d1 d d x x pa0 pad status i i d 0 b d 0 0b0b pa1 pad status i d i i i d 1 dd0 b note: i input; o output;  d, d0, d1 data b buzzer option, bz or bz x don t care; c cmos output the pb port is also used for the a/d converter inputs. the pwm outputs are shared with pins pc0~pc7 and pd0~pd7. if the pwm function is enabled, the pwm0~pwm15 outputs will appear on pins pc0~pc7 and pd0~pd7, if pc0~pc7 and pd0~pd7 are setup as outputs. writing a 1 to the pc0~pc7 and pd0~pd7 data registers will enable the pwm output function while writing a 0 will force pc0~pc7 and pd0~pd7 to re - main at a 0 level. the i/o functions of pc0~pc7 and pd0~pd7 are shown in the table. i/o mode i/p (normal) o/p (normal) i/p (pwm) o/p (pwm) pc0~pc7, pd0~pd7 logical input logical output logical input pwm0~ pwm15 any unused pins must be carefully managed to ensure that there are no floating input lines which will result in in- creased power consumption. it is therefore recom- mended that any unused pins are setup as outputs or connected to a pull-high resistor if setup as inputs. the definitions of the pfd control signals and the pfd output frequencies are listed in the following table. timer timer preload value pa3 data register pa3 pad state pfd frequency off x 0 0 x off x 1 u x on n 0 0 x on n 1 pfd f tmr /[2(m-n)] note: x stands for unused u stands for unknown m is 65536 for pfd0 or pfd1 n is the timer/event counter preload value  f tmr  is the input clock frequency for the timer/event counter 4          0   =  ( >   % ,   5    % ' $   '   ' 
2 !    % ' $   '  : ' 
2 !    / ' $   '  6 ' 
2 !    / ' $   '  5 ' 
2 !  !   ' &  a <  =  ' 
2 ! >    '    '       % -  / -  ( -   % ,   5 -   % ,   5  h  )   h  ) h   
  2 ' *       ' *  &   '  
  2 '       #   '      '  
  2 '      &   '    '         ' *   % - * ;  / - * ;    ( -  0    -    %  : -    %  6 -    /  5 -    /  * % -  % ,  * 5 -  5   % -  &  % ,   5 -  &  5   % -  &  7 ,   5 -  &  / : h * ; - * ; -  0  -  &  % ,  &  5 -  &  7 ,  &  / : input/output ports
ht46r652 rev. 1.10 22 may 25, 2011 pwm the microcontroller provides a 16-channel pwm output shared with pins pc0~pc7 and pd0~pd7. its output signals can be configured as (6+2) or (7+1) type de - pendent upon configuration options. each pwm chan - nel has its own 8-bit data register, denoted as pwm0~pwm15. the pwm frequency source comes from f sys . once the pc0~pc7 and pd0~pd7 pins are selected as pwm outputs, if the pins are setup as out - puts, writing a 1 to the pc0~pc7 and pd0~pd7 data registers will enable the corresponding pwm output function, while writing a 0 will force the pc0~pc7 and pd0~pd7 pins to remain at 0. in the (6+2) mode, the pwm cycle is divided into four modulation cycles, modulation cycle 0~modulation cy - cle 3. each modulation cycle has 64 pwm input clock periods. in the (6+2) mode, the contents of each pwm register is divided into two groups. group 1 of the pwm register is denoted by a dc which is the value of pwm.7~pwm.2. group 2 is denoted by ac which is the value of pwm.1~pwm.0. in the (6+2) mode, the duty cycle of each modulation cy - cle is shown in the table. parameter ac (0~3) duty cycle modulation cycle i (i=0~3) i '  !  2 ' %  &  '    2   
'      ' d ' 6  - $  1     2   
'  !  2 ' /    2   
'  !  2 '     2   
'  !  2 ' (    2   
'  !  2 ' % (6+2) pwm mode $  1  -   &  i  &  j ' k / % % i  &  j ' k / % /  &  i  &  j ' k / %   &  i  &  j ' k / % (  &   &  '    2   
'      ' d ' /  7 - $  1  : % - /  7 : / - /  7 : / - /  7 :  - /  7 : % - /  7 : % - /  7 : / - /  7 : / - /  7 : % - /  7 : / - /  7 : / - /  7 :  - /  7    2   
'  !  2 ' %  &  '  !  2 ' d '  : 6 - $  1     2   
'  !  2 ' /    2   
'  !  2 ' % (7+1) pwm mode
ht46r652 rev. 1.10 23 may 25, 2011 parameter ac (0~1) duty cycle modulation cycle i (i=0~1) i ht46r652 rev. 1.10 24 may 25, 2011 bit no. label function 0 1 2 acs0 acs1 acs2 defines the analog channel select. 3 4 5 pcr0 pcr1 pcr2 defines the port b configuration select. if pcr0, pcr1 and pcr2 are all zero, the adc circuit is powered off to reduce power consumption 6 eocb indicates end of a/d conversion. (0 = end of a/d conversion) each time bits 3~5 change state the a/d should be initialised by issuing a start signal, other - wise the eocb flag may have an undefined condition. see  important note for a/d initialisation. 7 start starts the a/d conversion. (0 1 0= start; 0 1= resets the a/d converter and sets eocb to 1) adcr (26h) register pcr2 pcr1 pcr0 76543210 0 0 0 pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 0 0 1 pb7 pb6 pb5 pb4 pb3 pb2 pb1 an0 0 1 0 pb7 pb6 pb5 pb4 pb3 pb2 an1 an0 0 1 1 pb7 pb6 pb5 pb4 pb3 an2 an1 an0 1 0 0 pb7 pb6 pb5 pb4 an3 an2 an1 an0 1 0 1 pb7 pb6 pb5 an4 an3 an2 an1 an0 1 1 0 pb7 pb6 an5 an4 an3 an2 an1 an0 1 1 1 an7 an6 an5 an4 an3 an2 an1 an0 port b configuration acs2 acs1 acs0 analog channel 0 0 0 an0 0 0 1 an1 0 1 0 an2 0 1 1 an3 1 0 0 an4 1 0 1 an5 1 1 0 an6 1 1 1 an7 analog input channel selection register bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 adrl d3 d2 d1 d0  adrh d11 d10 d9 d8 d7 d6 d5 d4 note: d0~d11 is the a/d conversion result data bit lsb~msb. adrl (24h), adrh (25h) register
ht46r652 rev. 1.10 25 may 25, 2011 the following programming example illustrates how to setup and implement an a/d conversion. the method of poll - ing the eocb bit in the adcr register is used to detect when the conversion cycle is complete. example: using eocb polling method to detect end of conversion clr eadi ; disable adc interrupt mov a,00000001b mov acsr,a ; setup the acsr register to select f sys /8 as the a/d clock mov a,00100000b ; setup adcr register to configure port pb0~pb3 as a/d inputs mov adcr,a ; and select an0 to be connected to the a/d converter : : ; as the port b channel bits have changed the following start ; signal (0-1-0) must be issued within 10 instruction cycles : start_conversion: clr start set start ; reset a/d clr start ; start a/d polling_eoc: sz eocb ; poll the adcr register eocb bit to detect an end of a/d conversion jmp polling_eoc ; continue polling mov a,adrh ; read the conversion result high byte value from the adrh register mov adrh_buffer,a ; save result to the user defined memory mov a,adrl ; read the conversion result low byte value from the adrl register mov adrl_buffer,a ; save the result to the user defined memory : : jmp start_conversion ; start the next a/d conversion   -  '  
+    
'     -  '  
+    
'     -  '  
+    
'   % % % * % % % * / % % * % / % *       *     ,    %    ,   %   c  < 
 
 '  $ ' -   
+    
/ d '  $ 
'  * '  
$      
 d '  2  ' 
 2   '  # 

2 -  '  2   a '   ' b ' $  1  -  9 ' $  1  - 7 '   ' $  1  - (     k (     k 7 %    d '    '  $ ' -   
+    
  ' -   
+   -  '     2 
 '   ' '    ' / % % * % % % *    '  $ ' -   
+    
  ' -   
+   % % % * / f '  * '    '   '   '  -    f ' -  '  
+   '   '   c   '  $ $ ' ' ' '  '    '   c  '  
    
/ % / * % % / *    '  $ ' -   
+    
  ' -   
+    
l '   
 '  $ ' -   
+    

 '  $ ' -   
+    
 
   ' 
' 
    
'  !  2 '
  9 '   ?    '
' 
    
'  !  2  '  2 2  c  -  '     2 
 '   ' '    ' -  '     2 
 '   ' '    ' a/d conversion timing
ht46r652 rev. 1.10 26 may 25, 2011 lcd display memory the device provides an area of embedded data memory for the lcd display. this area is located from 40h to 68h of the data memory inside bank 1. the bank pointer, known as bp, is used to select the lcd display memory. when the bp is set to 1 , any data written into locations 40h~68h will affect only the lcd display. when the bp is cleared to 0 or set to 2 , any data writ - ten into locations 40h~68h will access the general pur - pose data memory. the lcd display memory can be read and written to only by an indirect addressing mode using mp1. when data is written into the display data area, it is automatically read by the lcd driver which then generates the corresponding lcd driving signals. to turn the display on or off, a 1 or a 0 is written to the corresponding bit of the display memory, respectively. the figure illustrates the mapping between the display memory and lcd pattern for the device. lcd driver output the output number of the device lcd driver can be 41 2or41  3or40  4 by option, i.e., 1 / 2 duty, 1 / 3 duty or 1 / 4 duty. the lcd driver can either have an  r  type or  c  bias type. if the  r  bias type is selected, no external capacitors are required. if the  c  bias type is selected, a capacitor is required to be connected between the c1 and c2 pins. the lcd driver bias voltage can be 1 / 2 bias or 1 / 3 bias, selected via a configuration option. if the 1 / 2 bias is selected, a capacitor must be connected between the v2 pin and ground. if the 1 / 3 bias is se - lected, two capacitors are needed for the v1 and v2 pins.  % 3    % /  (       / 3   3  ( 3 6 6 3 6 5 3 6 7 3 *  % /  ( % /  ( ( 7 ( .  % display memory    % '    / '     '    ( ' "   '   
 '       '    ' 2   #  4 ' 4 * 4  4   4   4   4   4   4 ' 4 * 4  4 ' 4 * 4  4 ' 4 * 4  4 ' 4 * 4    d ' / -  '  ! 9 ' / - ( ' b    9 '  ' !  d ' e 4 e ' ( -  ' 4 "   9 ' e 4 * e ' 4 "   9 ' e 4  e ' / -  ' 4 "   / -  '  ! 9 ' / - ( ' b    9 '  ' !  d ' e 4 e ' 4 "   9 ' e 4 * e '  - ( ' 4 "   9 ' e 4  e ' / - ( ' 4 "   lcd driver output
ht46r652 rev. 1.10 27 may 25, 2011    % 9 '    / 9 '                        !    "    #    !  #     % 9    / 9     ' 4 "   ' / -  ' ' 4 "   ' 4   ' 4 "   ' / -  ' ' 4 "   ' 4   ' 2 2 ' ' "   '    +  '    '    % '    / '              4 "   ' / -  ' ' 4 "   ' 4   ' 4 "   ' / -  ' ' 4 "   ' 4   ' 4 "   ' / -  ' ' 4 "   ' 4   ' 4 "   ' / -  ' ' 4 "   ' 4   ' 4 "   ' / -  ' ' 4 "   ' 4   ' 4 "   ' / -  ' ' 4 "   ' 4   ' 4 "   ' / -  ' ' 4 "   ' 4   ' 4 "   ' / -  ' ' 4 "   ' 4   ' 4 "   ' / -  ' ' 4 "   ' 4   ' 4 "   ' / -  ' ' 4 "   ' 4   ' 4 "   ' / -  ' ' 4 "   ' 4   ' 4 "   ' / -  ' ' 4 "   ' 4   ' 4 "   / -  ' ' 4 "   ' 4   '      d ' e  e '    ' ' # '     '   
 2 9 '  $ ' # ' / -  '  ! ' "   '   '   f "   '   
 ' '      % 9 / 9 '  '     '   '
2   #  ' 
2 ! ' "   '   
 '   ' '    % '    '   ' 2   #  ' 
2 ! ' "   '   
 '   ' '    / '    '   ' 2   #  
2 ! ' "   '   
 '   ' '     '    '   ' 2   #  "   '   
 '      % 9 / '     '   ' 2   #  ' "   '   
 '   ' '    % 9 '  '     '   ' 2   #  ' "   '   
 '      / 9 '  '     '   ' 2   #  ' "   '   
 '   '    % 9 / 9 '  '     '   ' 2   #  ' 2 2 ' 2   '    +  '    lcd driver output - 1 / 3 duty, 1 / 2 bias, r/c type lcd segments as logic outputs the seg0~seg23 pins can also can be setup as logic outputs via a configuration options. once an lcd segment is con - figured as a logic output, the content of bit0 of the related segment address in the lcd ram will appear on the segment. pins seg0~seg7 and seg8~seg15 are together byte optioned as logic outputs, seg16~seg23 are individually bit optioned as logic outputs. lcd type r type c type lcd bias type 1 / 2 bias 1 / 3 bias 1 / 2 bias 1 / 3 bias v max if v dd >v lcd , then v max connect to v dd, else v max connect to v lcd if v dd > 3 2 v lcd , then v max connect to v dd , else v max connect to v1
ht46r652 rev. 1.10 28 may 25, 2011 low voltage reset/detector functions a low voltage detector, lvd, and low voltage reset, lvr, functions are implemented within the microcontroller. these two functions can be enabled/disabled by options. once the lvd option is enabled, the user can use the rtcc.3 to en - able/disable (1/0) the lvd circuit and read the lvd detector status (0/1) from rtcc.5; otherwise, the lvd function is disabled. the rtcc register definitions are listed below. bit no. label function 0~2 rt0~rt2 8 to 1 multiplexer control inputs to select the real clock prescaler output 3 lvdc lvd enable/disable (1/0) 4 qosc 32768hz osc quick start-up oscillator 0/1: quickly/slowly start 5 lvdo lvd detection output (1/0) 1: low voltage detected, read only 6, 7  unused bit, read as 0 rtcc (09h) register the lvr has the same effect or function as the external res signal which performs a chip reset. during the halt state, both lvr and lvd are disabled. the microcontroller provides a low voltage reset circuit in order to monitor the supply voltage of the device. if the supply voltage of the device is within the range 0.9v~v lvr , such as when changing a battery, the lvr will automatically reset the device internally. the lvr includes the following specifications:  the low voltage (0.9v~v lvr ) has to remain in its origi- nal state for longer than 1ms. if the low voltage state does not exceed 1ms, the lvr will ignore it and will not perform a reset function.  the lvr uses an  or function with the external res signal to perform a chip reset. the relationship between v dd and v lvr is shown below. note: v opr is the voltage range for proper chip operation with a 4mhz system clock. : f : 4 ( f % 4  f  4 % f . 4 4   4    4 " 4  : f : 4 4   : f : 4 4 " 4  % f . 4 % 4   '   
 2   g / g       2 '      
  " 4  '   ' 4  2   low voltage reset note: *1: to make sure that the system oscillator has stabilized, the sst provides an extra delay of 1024 system clock pulses before starting normal operation. *2: since a low voltage state has to be maintained its original state for over t lvr , therefore after t lvr delay, the device enters the reset mode.
ht46r652 rev. 1.10 29 may 25, 2011 configuration options the following shows the configuration options in the device. all these options must be defined in order to ensure proper functioning of the microcontroller. options osc type selection. this option is to decide if an rc or crystal or 32768hz crystal oscillator is chosen as the system clock. wdt, rtc and time base clock source selection. there are three types of selections: system clock/4 or rtc osc or wdt osc. wdt enable/disable selection. wdt can be enabled or disabled by option. wdt time-out period selection. there are four types of selection: wdt clock source divided by 2 12 /f s ~2 13 /f s , 2 13 /f s ~2 14 /f s ,2 14 /f s ~2 15 /f s or 2 15 /f s ~2 16 /f s . clr wdt times selection. this option defines the method to clear the wdt by instruction.  one time means that the  clr wdt instruction can clear the wdt.  two times means only if both of the  clr wdt1 and  clr wdt2 instructions have been executed, the wdt can be cleared. time base time-out period selection. the time base time-out period ranges from 2 12 /f s to 2 15 /f s .  f s  means the clock source selected by options. buzzer output frequency selection. there are eight types of frequency signals for buzzer output: f s /2 2 ~f s /2 9 . f s  means the clock source selected by options. wake-up selection. this option defines the wake-up capability. external i/o pins (pa only) all have the capability to wake-up the chip from a halt by a falling edge (bit option). pull-high selection. this option is to decide whether the pull-high resistance is visible or not in the input mode of the i/o ports. pa, pb, pc and pd can be independently selected (bit option). i/o pins shared with other function selections. pa0/bz , pa1/bz: pa0 and pa1 can be set as i/o pins or as buzzer outputs. lcd common selection. there are three types of selections: 2 common (1 / 2 duty) or 3 common (1 / 3 duty) or 4 com- mon (1 / 4 duty). if the 4 common is selected, the segment output pin seg40 will be setup as a common output. lcd bias power supply selection. there are two types of selections: 1 / 2 bias or 1 / 3 bias lcd bias type selection. this option is to determine what kind of bias is selected, r type or c type. lcd driver clock frequency selection. there are seven types of frequency signals for the lcd driver circuits: f s /2 2 ~f s /2 8 . f s  stands for the clock source se - lection by options. lcd on/off at halt selection. lcd segments as logical output selection, (byte, byte, bit, bit, bit, bit, bit, bit, bit, bit option) [seg0~seg7], [seg8~seg15], seg16, seg17, seg18, seg19, seg20, seg21, seg22, or seg23 lvr selection. lvr enable\disable option lvd selection. lvd enable\disable option pfd selection. if pa3 is setup as a pfd output, there are two types of selections; one is pfd0 as the pfd output, the other is pfd1 as the pfd output. pfd0, pfd1 are the timer overflow signals of the timer/event counter 0 and timer/event counter 1, respectively. pwm selection: (7+1) or (6+2) mode pc0~pc7: general purpose i/os or pwm outputs (port option  no individual pin selection) pd0~pd7: general purpose i/o or pwm output (bit option  individual pin selection) int0 or int1 triggering edge selection: disable; high to low; low to high; low to high or high to low. lcd bias current selection: low/high driving current (for r type only).
application circuits the following table shows the c1, c2 and r1 values corresponding to the different crystal values. (for reference only) crystal or resonator c1, c2 r1 4mhz crystal 25pf 12k 4mhz resonator 10pf 18k 3.58mhz crystal 25pf 12k 3.58mhz resonator 10pf 15k 2mhz crystal & resonator 25pf 12k 1mhz crystal 68pf 24k 480khz resonator 100pf 12k 455khz resonator 200pf 12k 429khz resonator 200pf 12k 400khz resonator 300pf 10k the function of the resistor r1 is to ensure that the oscillator will switch off should low voltage conditions occur. such a low voltage, as mentioned here, is one which is less than the lowest value of the mcu operating volt - age. note however that if the lvr is enabled then r1 can be removed. note: the resistance and capacitance for reset circuit should be designed in such a way as to ensure that the vdd is stable and remains within a valid operating voltage range before bringing res to high. * make the length of the wiring, which is connected to the res pin as short as possible, to avoid noise interference. vmax connect to vdd or vlcd or v1 refer to the table. lcd type r type c type lcd bias type 1 / 2 bias 1 / 3 bias vmax if v dd >v lcd , then vmax connect to v dd , else vmax connect to v lcd if v dd >3 / 2v lcd , then vmax connect to v dd , else vmax connect to v1 ht46r652 rev. 1.10 30 may 25, 2011                     

 
                          
                     
  
   ! " # $ %    &    
  
  
  '  (  ' ) *
    +    ,     

            +    - .    - .           /  *    0 1  /    " 1  /    ! /  *    -      - !   !     2  #   !  2   0    ,  
  
 
             
   ) 3   4 5    6 7 6    ) 5 8    8                 
 ,  9 * 
 9       * 
 :
;

  
  !   *         
   
  
         
            

   5 < =  
     : )  < (  < <  ( )  =    
           2     !  2  ! 
ht46r652 rev. 1.10 31 may 25, 2011 instruction set introduction central to the successful operation of any microcontroller is its instruction set, which is a set of pro - gram instruction codes that directs the microcontroller to perform certain operations. in the case of holtek microcontroller , a comprehensive and flexible set of over 60 instructions is provided to enable programmers to implement their application with the minimum of pro - gramming overheads. for easier understanding of the various instruction codes, they have been subdivided into several func - tional groupings. instruction timing most instructions are implemented within one instruc - tion cycle. the exceptions to this are branch, call, or ta - ble read instructions where two instruction cycles are required. one instruction cycle is equal to 4 system clock cycles, therefore in the case of an 8mhz system oscillator, most instructions would be implemented within 0.5  s and branch or call instructions would be im - plemented within 1  s. although instructions which re - quire one more cycle to implement are generally limited to the jmp, call, ret, reti and table read instruc- tions, it is important to realize that any other instructions which involve manipulation of the program counter low register or pcl will also take one more cycle to imple- ment. as instructions which change the contents of the pcl will imply a direct jump to that new address, one more cycle will be required. examples of such instruc- tions would be  clr pcl or  mov pcl, a . for the case of skip instructions, it must be noted that if the re- sult of the comparison involves a skip operation then this will also take one more cycle, if no skip is involved then only one cycle is required. moving and transferring data the transfer of data within the microcontroller program is one of the most frequently used operations. making use of three kinds of mov instructions, data can be transferred from registers to the accumulator and vice-versa as well as being able to move specific imme - diate data directly into the accumulator. one of the most important data transfer applications is to receive data from the input ports and transfer data to the output ports. arithmetic operations the ability to perform certain arithmetic operations and data manipulation is a necessary feature of most microcontroller applications. within the holtek microcontroller instruction set are a range of add and subtract instruction mnemonics to enable the necessary arithmetic to be carried out. care must be taken to en - sure correct handling of carry and borrow data when re - sults exceed 255 for addition and less than 0 for sub - traction. the increment and decrement instructions inc, inca, dec and deca provide a simple means of increasing or decreasing by a value of one of the values in the destination specified. logical and rotate operations the standard logical operations such as and, or, xor and cpl all have their own instruction within the holtek microcontroller instruction set. as with the case of most instructions involving data manipulation, data must pass through the accumulator which may involve additional programming steps. in all logical data operations, the zero flag may be set if the result of the operation is zero. another form of logical data manipulation comes from the rotate instructions such as rr, rl, rrc and rlc which provide a simple means of rotating one bit right or left. different rotate instructions exist depending on pro - gram requirements. rotate instructions are useful for serial port programming applications where data can be rotated from an internal register into the carry bit from where it can be examined and the necessary serial bit set high or low. another application where rotate data operations are used is to implement multiplication and division calculations. branches and control transfer program branching takes the form of either jumps to specified locations using the jmp instruction or to a sub- routine using the call instruction. they differ in the sense that in the case of a subroutine call, the program must return to the instruction immediately when the sub- routine has been carried out. this is done by placing a return instruction ret in the subroutine which will cause the program to jump back to the address right after the call instruction. in the case of a jmp instruction, the program simply jumps to the desired location. there is no requirement to jump back to the original jumping off point as in the case of the call instruction. one special and extremely useful set of branch instructions are the conditional branches. here a decision is first made re - garding the condition of a certain data memory or indi - vidual bits. depending upon the conditions, the program will continue with the next instruction or skip over it and jump to the following instruction. these instructions are the key to decision making and branching within the pro - gram perhaps determined by the condition of certain in - put switches or by the condition of internal data bits.
ht46r652 rev. 1.10 32 may 25, 2011 bit operations the ability to provide single bit operations on data mem - ory is an extremely flexible feature of all holtek microcontrollers . this feature is especially useful for output port bit programming where individual bits or port pins can be directly set high or low using either the set [m].i or  clr [m].i instructions respectively. the fea - ture removes the need for programmers to first read the 8-bit output port, manipulate the input data to ensure that other bits are not changed and then output the port with the correct new data. this read-modify-write pro - cess is taken care of automatically when these bit oper - ation instructions are used. table read operations data storage is normally implemented by using regis - ters. however, when working with large amounts of fixed data, the volume involved often makes it inconve - nient to store the fixed data in the data memory. to over - come this problem, holtek microcontrollers allow an area of program memory to be setup as a table where data can be directly stored. a set of easy to use instruc - tions provides the means by which this fixed data can be referenced and retrieved from the program memory. other operations in addition to the above functional instructions, a range of other instructions also exist such as the  halt in - struction for power-down operations and instructions to control the operation of the watchdog timer for reliable program operations under extreme electric or electro - magnetic environments. for their relevant operations, refer to the functional related sections. instruction set summary the following table depicts a summary of the instruction set categorised according to function and can be con - sulted as a basic instruction reference using the follow - ing listed conventions. table conventions: x: bits immediate data m: data memory address a: accumulator i: 0~7 number of bits addr: program memory address mnemonic description cycles flag affected arithmetic add a,[m] addm a,[m] add a,x adc a,[m] adcm a,[m] sub a,x sub a,[m] subm a,[m] sbc a,[m] sbcm a,[m] daa [m] add data memory to acc add acc to data memory add immediate data to acc add data memory to acc with carry add acc to data memory with carry subtract immediate data from the acc subtract data memory from acc subtract data memory from acc with result in data memory subtract data memory from acc with carry subtract data memory from acc with carry, result in data memory decimal adjust acc for addition with result in data memory 1 1 note 1 1 1 note 1 1 1 note 1 1 note 1 note z, c, ac, ov z, c, ac, ov z, c, ac, ov z, c, ac, ov z, c, ac, ov z, c, ac, ov z, c, ac, ov z, c, ac, ov z, c, ac, ov z, c, ac, ov c logic operation and a,[m] or a,[m] xor a,[m] andm a,[m] orm a,[m] xorm a,[m] and a,x or a,x xor a,x cpl [m] cpla [m] logical and data memory to acc logical or data memory to acc logical xor data memory to acc logical and acc to data memory logical or acc to data memory logical xor acc to data memory logical and immediate data to acc logical or immediate data to acc logical xor immediate data to acc complement data memory complement data memory with result in acc 1 1 1 1 note 1 note 1 note 1 1 1 1 note 1 z z z z z z z z z z z increment & decrement inca [m] inc [m] deca [m] dec [m] increment data memory with result in acc increment data memory decrement data memory with result in acc decrement data memory 1 1 note 1 1 note z z z z
ht46r652 rev. 1.10 33 may 25, 2011 mnemonic description cycles flag affected rotate rra [m] rr [m] rrca [m] rrc [m] rla [m] rl [m] rlca [m] rlc [m] rotate data memory right with result in acc rotate data memory right rotate data memory right through carry with result in acc rotate data memory right through carry rotate data memory left with result in acc rotate data memory left rotate data memory left through carry with result in acc rotate data memory left through carry 1 1 note 1 1 note 1 1 note 1 1 note none none c c none none c c data move mov a,[m] mov [m],a mov a,x move data memory to acc move acc to data memory move immediate data to acc 1 1 note 1 none none none bit operation clr [m].i set [m].i clear bit of data memory set bit of data memory 1 note 1 note none none branch jmp addr sz [m] sza [m] sz [m].i snz [m].i siz [m] sdz [m] siza [m] sdza [m] call addr ret ret a,x reti jump unconditionally skip if data memory is zero skip if data memory is zero with data movement to acc skip if bit i of data memory is zero skip if bit i of data memory is not zero skip if increment data memory is zero skip if decrement data memory is zero skip if increment data memory is zero with result in acc skip if decrement data memory is zero with result in acc subroutine call return from subroutine return from subroutine and load immediate data to acc return from interrupt 2 1 note 1 note 1 note 1 note 1 note 1 note 1 note 1 note 2 2 2 2 none none none none none none none none none none none none none table read tabrdc [m] tabrdl [m] read table (current page) to tblh and data memory read table (last page) to tblh and data memory 2 note 2 note none none miscellaneous nop clr [m] set [m] clr wdt clr wdt1 clr wdt2 swap [m] swapa [m] halt no operation clear data memory set data memory clear watchdog timer pre-clear watchdog timer pre-clear watchdog timer swap nibbles of data memory swap nibbles of data memory with result in acc enter power down mode 1 1 note 1 note 1 1 1 1 note 1 1 none none none to, pdf to, pdf to, pdf none none to, pdf note: 1. for skip instructions, if the result of the comparison involves a skip then two cycles are required, if no skip takes place only one cycle is required. 2. any instruction which changes the contents of the pcl will also require 2 cycles for execution. 3. for the  clr wdt1 and  clr wdt2 instructions the to and pdf flags may be affected by the execution status. the to and pdf flags are cleared after both  clr wdt1 and  clr wdt2 instructions are consecutively executed. otherwise the to and pdf flags remain unchanged.
instruction definition adc a,[m] add data memory to acc with carry description the contents of the specified data memory, accumulator and the carry flag are added. the result is stored in the accumulator. operation acc  acc+[m]+c affected flag(s) ov, z, ac, c adcm a,[m] add acc to data memory with carry description the contents of the specified data memory, accumulator and the carry flag are added. the result is stored in the specified data memory. operation [m]  acc+[m]+c affected flag(s) ov, z, ac, c add a,[m] add data memory to acc description the contents of the specified data memory and the accumulator are added. the result is stored in the accumulator. operation acc  acc + [m] affected flag(s) ov, z, ac, c add a,x add immediate data to acc description the contents of the accumulator and the specified immediate data are added. the result is stored in the accumulator. operation acc  acc+x affected flag(s) ov, z, ac, c addm a,[m] add acc to data memory description the contents of the specified data memory and the accumulator are added. the result is stored in the specified data memory. operation [m]  acc + [m] affected flag(s) ov, z, ac, c and a,[m] logical and data memory to acc description data in the accumulator and the specified data memory perform a bitwise logical and op - eration. the result is stored in the accumulator. operation acc  acc and [m] affected flag(s) z and a,x logical and immediate data to acc description data in the accumulator and the specified immediate data perform a bitwise logical and operation. the result is stored in the accumulator. operation acc  acc and x affected flag(s) z andm a,[m] logical and acc to data memory description data in the specified data memory and the accumulator perform a bitwise logical and op - eration. the result is stored in the data memory. operation [m]  acc and [m] affected flag(s) z ht46r652 rev. 1.10 34 may 25, 2011
call addr subroutine call description unconditionally calls a subroutine at the specified address. the program counter then in - crements by 1 to obtain the address of the next instruction which is then pushed onto the stack. the specified address is then loaded and the program continues execution from this new address. as this instruction requires an additional operation, it is a two cycle instruc - tion. operation stack  program counter + 1 program counter  addr affected flag(s) none clr [m] clear data memory description each bit of the specified data memory is cleared to 0. operation [m]  00h affected flag(s) none clr [m].i clear bit of data memory description bit i of the specified data memory is cleared to 0. operation [m].i  0 affected flag(s) none clr wdt clear watchdog timer description the to, pdf flags and the wdt are all cleared. operation wdt cleared to  0 pdf  0 affected flag(s) to, pdf clr wdt1 pre-clear watchdog timer description the to, pdf flags and the wdt are all cleared. note that this instruction works in conjunc- tion with clr wdt2 and must be executed alternately with clr wdt2 to have effect. re- petitively executing this instruction without alternately executing clr wdt2 will have no effect. operation wdt cleared to  0 pdf  0 affected flag(s) to, pdf clr wdt2 pre-clear watchdog timer description the to, pdf flags and the wdt are all cleared. note that this instruction works in conjunc - tion with clr wdt1 and must be executed alternately with clr wdt1 to have effect. re - petitively executing this instruction without alternately executing clr wdt1 will have no effect. operation wdt cleared to  0 pdf  0 affected flag(s) to, pdf ht46r652 rev. 1.10 35 may 25, 2011
cpl [m] complement data memory description each bit of the specified data memory is logically complemented (1 s complement). bits which previously contained a 1 are changed to 0 and vice versa. operation [m]  [m] affected flag(s) z cpla [m] complement data memory with result in acc description each bit of the specified data memory is logically complemented (1 s complement). bits which previously contained a 1 are changed to 0 and vice versa. the complemented result is stored in the accumulator and the contents of the data memory remain unchanged. operation acc  [m] affected flag(s) z daa [m] decimal-adjust acc for addition with result in data memory description convert the contents of the accumulator value to a bcd ( binary coded decimal) value re - sulting from the previous addition of two bcd variables. if the low nibble is greater than 9 or if ac flag is set, then a value of 6 will be added to the low nibble. otherwise the low nibble remains unchanged. if the high nibble is greater than 9 or if the c flag is set, then a value of 6 will be added to the high nibble. essentially, the decimal conversion is performed by add - ing 00h, 06h, 60h or 66h depending on the accumulator and flag conditions. only the c flag may be affected by this instruction which indicates that if the original bcd sum is greater than 100, it allows multiple precision decimal addition. operation [m]  acc + 00h or [m]  acc + 06h or [m]  acc + 60h or [m]  acc + 66h affected flag(s) c dec [m] decrement data memory description data in the specified data memory is decremented by 1. operation [m]  [m]  1 affected flag(s) z deca [m] decrement data memory with result in acc description data in the specified data memory is decremented by 1. the result is stored in the accu - mulator. the contents of the data memory remain unchanged. operation acc  [m]  1 affected flag(s) z halt enter power down mode description this instruction stops the program execution and turns off the system clock. the contents of the data memory and registers are retained. the wdt and prescaler are cleared. the power down flag pdf is set and the wdt time-out flag to is cleared. operation to  0 pdf  1 affected flag(s) to, pdf ht46r652 rev. 1.10 36 may 25, 2011
inc [m] increment data memory description data in the specified data memory is incremented by 1. operation [m]  [m]+1 affected flag(s) z inca [m] increment data memory with result in acc description data in the specified data memory is incremented by 1. the result is stored in the accumu - lator. the contents of the data memory remain unchanged. operation acc  [m]+1 affected flag(s) z jmp addr jump unconditionally description the contents of the program counter are replaced with the specified address. program execution then continues from this new address. as this requires the insertion of a dummy instruction while the new address is loaded, it is a two cycle instruction. operation program counter  addr affected flag(s) none mov a,[m] move data memory to acc description the contents of the specified data memory are copied to the accumulator. operation acc  [m] affected flag(s) none mov a,x move immediate data to acc description the immediate data specified is loaded into the accumulator. operation acc  x affected flag(s) none mov [m],a move acc to data memory description the contents of the accumulator are copied to the specified data memory. operation [m]  acc affected flag(s) none nop no operation description no operation is performed. execution continues with the next instruction. operation no operation affected flag(s) none or a,[m] logical or data memory to acc description data in the accumulator and the specified data memory perform a bitwise logical or oper - ation. the result is stored in the accumulator. operation acc  acc or [m] affected flag(s) z ht46r652 rev. 1.10 37 may 25, 2011
or a,x logical or immediate data to acc description data in the accumulator and the specified immediate data perform a bitwise logical or op - eration. the result is stored in the accumulator. operation acc  acc or x affected flag(s) z orm a,[m] logical or acc to data memory description data in the specified data memory and the accumulator perform a bitwise logical or oper - ation. the result is stored in the data memory. operation [m]  acc or [m] affected flag(s) z ret return from subroutine description the program counter is restored from the stack. program execution continues at the re - stored address. operation program counter  stack affected flag(s) none ret a,x return from subroutine and load immediate data to acc description the program counter is restored from the stack and the accumulator loaded with the specified immediate data. program execution continues at the restored address. operation program counter  stack acc  x affected flag(s) none reti return from interrupt description the program counter is restored from the stack and the interrupts are re-enabled by set- ting the emi bit. emi is the master interrupt global enable bit. if an interrupt was pending when the reti instruction is executed, the pending interrupt routine will be processed be- fore returning to the main program. operation program counter  stack emi  1 affected flag(s) none rl [m] rotate data memory left description the contents of the specified data memory are rotated left by 1 bit with bit 7 rotated into bit 0. operation [m].(i+1)  [m].i; (i = 0~6) [m].0  [m].7 affected flag(s) none rla [m] rotate data memory left with result in acc description the contents of the specified data memory are rotated left by 1 bit with bit 7 rotated into bit 0. the rotated result is stored in the accumulator and the contents of the data memory re - main unchanged. operation acc.(i+1)  [m].i; (i = 0~6) acc.0  [m].7 affected flag(s) none ht46r652 rev. 1.10 38 may 25, 2011
rlc [m] rotate data memory left through carry description the contents of the specified data memory and the carry flag are rotated left by 1 bit. bit 7 replaces the carry bit and the original carry flag is rotated into bit 0. operation [m].(i+1)  [m].i; (i = 0~6) [m].0  c c  [m].7 affected flag(s) c rlca [m] rotate data memory left through carry with result in acc description data in the specified data memory and the carry flag are rotated left by 1 bit. bit 7 replaces the carry bit and the original carry flag is rotated into the bit 0. the rotated result is stored in the accumulator and the contents of the data memory remain unchanged. operation acc.(i+1)  [m].i; (i = 0~6) acc.0  c c  [m].7 affected flag(s) c rr [m] rotate data memory right description the contents of the specified data memory are rotated right by 1 bit with bit 0 rotated into bit 7. operation [m].i  [m].(i+1); (i = 0~6) [m].7  [m].0 affected flag(s) none rra [m] rotate data memory right with result in acc description data in the specified data memory and the carry flag are rotated right by 1 bit with bit 0 ro- tated into bit 7. the rotated result is stored in the accumulator and the contents of the data memory remain unchanged. operation acc.i  [m].(i+1); (i = 0~6) acc.7  [m].0 affected flag(s) none rrc [m] rotate data memory right through carry description the contents of the specified data memory and the carry flag are rotated right by 1 bit. bit 0 replaces the carry bit and the original carry flag is rotated into bit 7. operation [m].i  [m].(i+1); (i = 0~6) [m].7  c c  [m].0 affected flag(s) c rrca [m] rotate data memory right through carry with result in acc description data in the specified data memory and the carry flag are rotated right by 1 bit. bit 0 re - places the carry bit and the original carry flag is rotated into bit 7. the rotated result is stored in the accumulator and the contents of the data memory remain unchanged. operation acc.i  [m].(i+1); (i = 0~6) acc.7  c c  [m].0 affected flag(s) c ht46r652 rev. 1.10 39 may 25, 2011
sbc a,[m] subtract data memory from acc with carry description the contents of the specified data memory and the complement of the carry flag are sub - tracted from the accumulator. the result is stored in the accumulator. note that if the result of subtraction is negative, the c flag will be cleared to 0, otherwise if the result is positive or zero, the c flag will be set to 1. operation acc  acc  [m]  c affected flag(s) ov, z, ac, c sbcm a,[m] subtract data memory from acc with carry and result in data memory description the contents of the specified data memory and the complement of the carry flag are sub - tracted from the accumulator. the result is stored in the data memory. note that if the re - sult of subtraction is negative, the c flag will be cleared to 0, otherwise if the result is positive or zero, the c flag will be set to 1. operation [m]  acc  [m]  c affected flag(s) ov, z, ac, c sdz [m] skip if decrement data memory is 0 description the contents of the specified data memory are first decremented by 1. if the result is 0 the following instruction is skipped. as this requires the insertion of a dummy instruction while the next instruction is fetched, it is a two cycle instruction. if the result is not 0 the program proceeds with the following instruction. operation [m]  [m]  1 skip if [m] = 0 affected flag(s) none sdza [m] skip if decrement data memory is zero with result in acc description the contents of the specified data memory are first decremented by 1. if the result is 0, the following instruction is skipped. the result is stored in the accumulator but the specified data memory contents remain unchanged. as this requires the insertion of a dummy in- struction while the next instruction is fetched, it is a two cycle instruction. if the result is not 0, the program proceeds with the following instruction. operation acc  [m]  1 skip if acc = 0 affected flag(s) none set [m] set data memory description each bit of the specified data memory is set to 1. operation [m]  ffh affected flag(s) none set [m].i set bit of data memory description bit i of the specified data memory is set to 1. operation [m].i  1 affected flag(s) none ht46r652 rev. 1.10 40 may 25, 2011
siz [m] skip if increment data memory is 0 description the contents of the specified data memory are first incremented by 1. if the result is 0, the following instruction is skipped. as this requires the insertion of a dummy instruction while the next instruction is fetched, it is a two cycle instruction. if the result is not 0 the program proceeds with the following instruction. operation [m]  [m]+1 skip if [m] = 0 affected flag(s) none siza [m] skip if increment data memory is zero with result in acc description the contents of the specified data memory are first incremented by 1. if the result is 0, the following instruction is skipped. the result is stored in the accumulator but the specified data memory contents remain unchanged. as this requires the insertion of a dummy in - struction while the next instruction is fetched, it is a two cycle instruction. if the result is not 0 the program proceeds with the following instruction. operation acc  [m]+1 skip if acc = 0 affected flag(s) none snz [m].i skip if bit i of data memory is not 0 description if bit i of the specified data memory is not 0, the following instruction is skipped. as this re - quires the insertion of a dummy instruction while the next instruction is fetched, it is a two cycle instruction. if the result is 0 the program proceeds with the following instruction. operation skip if [m].i  0 affected flag(s) none sub a,[m] subtract data memory from acc description the specified data memory is subtracted from the contents of the accumulator. the result is stored in the accumulator. note that if the result of subtraction is negative, the c flag will be cleared to 0, otherwise if the result is positive or zero, the c flag will be set to 1. operation acc  acc  [m] affected flag(s) ov, z, ac, c subm a,[m] subtract data memory from acc with result in data memory description the specified data memory is subtracted from the contents of the accumulator. the result is stored in the data memory. note that if the result of subtraction is negative, the c flag will be cleared to 0, otherwise if the result is positive or zero, the c flag will be set to 1. operation [m]  acc  [m] affected flag(s) ov, z, ac, c sub a,x subtract immediate data from acc description the immediate data specified by the code is subtracted from the contents of the accumu - lator. the result is stored in the accumulator. note that if the result of subtraction is nega - tive, the c flag will be cleared to 0, otherwise if the result is positive or zero, the c flag will be set to 1. operation acc  acc  x affected flag(s) ov, z, ac, c ht46r652 rev. 1.10 41 may 25, 2011
swap [m] swap nibbles of data memory description the low-order and high-order nibbles of the specified data memory are interchanged. operation [m].3~[m].0  [m].7 ~ [m].4 affected flag(s) none swapa [m] swap nibbles of data memory with result in acc description the low-order and high-order nibbles of the specified data memory are interchanged. the result is stored in the accumulator. the contents of the data memory remain unchanged. operation acc.3 ~ acc.0  [m].7 ~ [m].4 acc.7 ~ acc.4  [m].3 ~ [m].0 affected flag(s) none sz [m] skip if data memory is 0 description if the contents of the specified data memory is 0, the following instruction is skipped. as this requires the insertion of a dummy instruction while the next instruction is fetched, it is a two cycle instruction. if the result is not 0 the program proceeds with the following instruc - tion. operation skip if [m] = 0 affected flag(s) none sza [m] skip if data memory is 0 with data movement to acc description the contents of the specified data memory are copied to the accumulator. if the value is zero, the following instruction is skipped. as this requires the insertion of a dummy instruc - tion while the next instruction is fetched, it is a two cycle instruction. if the result is not 0 the program proceeds with the following instruction. operation acc  [m] skip if [m] = 0 affected flag(s) none sz [m].i skip if bit i of data memory is 0 description if bit i of the specified data memory is 0, the following instruction is skipped. as this re- quires the insertion of a dummy instruction while the next instruction is fetched, it is a two cycle instruction. if the result is not 0, the program proceeds with the following instruction. operation skip if [m].i = 0 affected flag(s) none tabrdc [m] read table (current page) to tblh and data memory description the low byte of the program code (current page) addressed by the table pointer (tblp) is moved to the specified data memory and the high byte moved to tblh. operation [m]  program code (low byte) tblh  program code (high byte) affected flag(s) none tabrdl [m] read table (last page) to tblh and data memory description the low byte of the program code (last page) addressed by the table pointer (tblp) is moved to the specified data memory and the high byte moved to tblh. operation [m]  program code (low byte) tblh  program code (high byte) affected flag(s) none ht46r652 rev. 1.10 42 may 25, 2011
xor a,[m] logical xor data memory to acc description data in the accumulator and the specified data memory perform a bitwise logical xor op - eration. the result is stored in the accumulator. operation acc  acc xor [m] affected flag(s) z xorm a,[m] logical xor acc to data memory description data in the specified data memory and the accumulator perform a bitwise logical xor op - eration. the result is stored in the data memory. operation [m]  acc xor [m] affected flag(s) z xor a,x logical xor immediate data to acc description data in the accumulator and the specified immediate data perform a bitwise logical xor operation. the result is stored in the accumulator. operation acc  acc xor x affected flag(s) z ht46r652 rev. 1.10 43 may 25, 2011
package information 100-pin lqfp (14mm  14mm) outline dimensions symbol dimensions in inch min. nom. max. a 0.626  0.634 b 0.547  0.555 c 0.626  0.634 d 0.547  0.555 e  0.020  f  0.008  g 0.053  0.057 h  0.063 i  0.004  j 0.018  0.030 k 0.004  0.008  07 symbol dimensions in mm min. nom. max. a 15.90  16.10 b 13.90  14.10 c 15.90  16.10 d 13.90  14.10 e  0.50  f  0.20  g 1.35  1.45 h  1.60 i  0.10  j 0.45  0.75 k 0.10  0.20  07 ht46r652 rev. 1.10 44 may 25, 2011 / % % /  : *   : %  6 0  3  n )  : / 5 : 5 6
ht46r652 rev. 1.10 45 may 25, 2011 holtek semiconductor inc. (headquarters) no.3, creation rd. ii, science park, hsinchu, taiwan tel: 886-3-563-1999 fax: 886-3-563-1189 http://www.holtek.com.tw holtek semiconductor inc. (taipei sales office) 4f-2, no. 3-2, yuanqu st., nankang software park, taipei 115, taiwan tel: 886-2-2655-7070 fax: 886-2-2655-7373 fax: 886-2-2655-7383 (international sales hotline) holtek semiconductor inc. (shenzhen sales office) 5f, unit a, productivity building, no.5 gaoxin m 2nd road, nanshan district, shenzhen, china 518057 tel: 86-755-8616-9908, 86-755-8616-9308 fax: 86-755-8616-9722 holtek semiconductor (usa), inc. (north america sales office) 46729 fremont blvd., fremont, ca 94538 tel: 1-510-252-9880 fax: 1-510-252-9885 http://www.holtek.com copyright  2011 by holtek semiconductor inc. the information appearing in this data sheet is believed to be accurate at the time of publication. however, holtek as - sumes no responsibility arising from the use of the specifications described. the applications mentioned herein are used solely for the purpose of illustration and holtek makes no warranty or representation that such applications will be suitable without further modification, nor recommends the use of its products for application that may present a risk to human life due to malfunction or otherwise. holtek s products are not authorized for use as critical components in life support devices or systems. holtek reserves the right to alter its products without prior notification. for the most up-to-date information, please visit our web site at http://www.holtek.com.tw.


▲Up To Search▲   

 
Price & Availability of HT46R65211

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X